﻿Imports GameEngine
Imports Microsoft.Xna.Framework.Graphics
Imports Microsoft.Xna.Framework

''' <summary>
''' Creates a 9 x 9 grid of objects. Was a useful reference when working on
''' Camera3D class.
''' </summary>
Public Class ReferenceObjects
    Inherits GameObject

    Public Sub New(ByVal GameManager As GameManager)
        MyBase.New(GameManager)
    End Sub

    Public Overrides Sub Initialize()
        MyBase.Initialize()

        IsSolid = False

        For z As Integer = 0 To 8
            For x As Integer = 0 To 8
                Children.Add(New GameObject(GameManager, Me, New Vector3(x * 60, 30, z * 60)))
            Next
        Next

    End Sub

    Public Overrides Sub LoadContent()
        MyBase.LoadContent()

        Dim m As New MyModel(GameManager.Game.Content.Load(Of Model)("box"))
        Dim t As Texture2D = GameManager.Game.Content.Load(Of Texture2D)("boxtexture")
        m.Texture = t
        For i As Integer = 0 To Children.Count - 2 Step 2
            Children(i).Models.Add(m)
        Next

        m = New MyModel(GameManager.Game.Content.Load(Of Model)("Vase1"))
        't = GameManager.Game.Content.Load(Of Texture2D)("VaseTexture")
        'm.Texture = t

        For i As Integer = 1 To Children.Count - 1 Step 2
            Children(i).Models.Add(m)
        Next
    End Sub

    Public Overrides Sub Draw(ByVal elapsedSeconds As Single, ByVal camera As GameEngine.Camera3D)
        MyBase.Draw(elapsedSeconds, camera)
    End Sub

End Class